package com.jiangjj.ssmdemo.city;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CityController {

    @Autowired
    private CityRepository cityRepository;

    @GetMapping("cities")
    public Page<City> cities() {
        return cityRepository.findAll(PageRequest.of(0, Integer.MAX_VALUE));
    }
}
